import request from '@/config/axios'

// 退款 VO
export interface UserRefundVO {
  id: number // id
  userId: number // 用户id
  refund: number // 退款金额
  aliAccount: string // 阿里账号
}

// 退款 API
export const UserRefundApi = {
  // 查询退款分页
  getUserRefundPage: async (data) => {
    return await request.post({ url: `/member/user-refund/page`, data:data })
  },

  // 查询退款详情
  getUserRefund: async (id: number) => {
    return await request.get({ url: `/member/user-refund/get?id=` + id })
  },

  // 新增退款
  createUserRefund: async (data: UserRefundVO) => {
    return await request.post({ url: `/member/user-refund/create`, data })
  },

  // 修改退款
  updateUserRefund: async (data: UserRefundVO) => {
    return await request.post({ url: `/member/user-refund/update`, data })
  },

  // 删除退款
  deleteUserRefund: async (id: number) => {
    return await request.delete({ url: `/member/user-refund/delete?id=` + id })
  },

  // 导出退款 Excel
  exportUserRefund: async (params) => {
    return await request.download({ url: `/member/user-refund/export-excel`, params })
  }
}
